import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'

Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import register from '@/views/register'
import center from '@/views/center'
import daoshixuanze from '@/views/modules/mentorxuanze/list'
import student from '@/views/modules/student/list'
import daoshi from '@/views/modules/mentor/list'
import mentorbeselected from '@/views/modules/mentorbeselected/list'
import myMentor from '@/views/modules/Mymentor/show.vue'
import studentSubmit from '@/views/modules/studentsubmit/list'
import studentState from '@/views/modules/studentstate/list.vue'
import round from '@/views/modules/round/list.vue'
import studentBeSelected from '@/views/modules/studentBeSelected/list.vue'
import successMatch from '@/views/modules/successMatch/list.vue'
import unselected from '@/views/modules/unselected/list.vue'
import unselectedBoth from '@/views/modules/unselectedBoth/list.vue'


//2.配置路由   注意：名字
const routes = [
    {
        path: '/index',
        name: '首页',
        component: Index,
        children: [{
            // 这里不设置值，是把main作为默认页面
            path: '/',
            name: '首页',
            component: Home,
            meta: {icon: '', title: 'center'}
        }, {
            path: '/updatePassword',
            name: '修改密码',
            component: UpdatePassword,
            meta: {icon: '', title: 'updatePassword'}
        }, {
            path: '/center',
            name: '个人信息',
            component: center,
            meta: {icon: '', title: 'center'}
        }, {
            path: '/round',
            name: '轮次管理',
            component: round
        },{
            path: '/mentorxuanze',
            name: '导师选择',
            component: daoshixuanze
        }, {
            path: '/mentorbeselected',
            name: '我的申请',
            component: mentorbeselected
        }, {
            path: '/myMentor',
            name: '我的导师',
            component: myMentor,
        }, {
            path: '/student',
            name: '学生',
            component: student
        }, {
           path: '/studentSubmit',
           name: '学生申请',
           component: studentSubmit
        }, {
            path: '/mentor',
            name: '导师',
            component: daoshi
        }, {
            path: '/successMatch',
            name: '成功匹配',
            component: successMatch
        }, {
            path: '/unselected',
            name: '强制匹配',
            component: unselected
        }, {
            path: '/unselectedBoth',
            name: '学生未受选/导师有名额',
            component: unselectedBoth
        }, {
            path: "/studentState",
            name: "学生申请",
            component: studentState
        }, {
            path: "/studentBeSelected",
            name: "我的学生",
            component: studentBeSelected
        }]
    },

    {
        path: '/login',
        name: 'login',
        component: Login,
        meta: {icon: '', title: 'login'}
    },
    {
        path: '/register',
        name: 'register',
        component: register,
        meta: {icon: '', title: 'register'}
    },
    {
        path: '/',
        name: '首页',
        redirect: '/index'
    }, /*默认跳转路由*/
    {
        path: '*',
        component: NotFound
    },
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
    mode: 'hash',
    /*hash模式改为history*/
    routes // （缩写）相当于 routes: routes
})

export default router;
